////////////////////////////////////////////////
// -- DepthHUD Lite                           //
// by Hurricaaane (Ha3)                       //
//                                            //
// http://www.youtube.com/user/Hurricaaane    //
//--------------------------------------------//
// Base panel                                 //
////////////////////////////////////////////////

local PANEL = {}

function PANEL:Init()
	self:SetMainSize( 2 )
	self:SetMainType( "number" )
	self:SetMainColor( color_white )
	self:UpdateMainFont( )
	
	self:SetSubAlign( 2 )
	self:SetSubText( "MS RENDER TIME" )
	
	self.LastTime = RealTime()
	
end

function PANEL:Think()
	local delta = RealTime() - self.LastTime
	self:SetRate( 1 - delta / 2 )
	self:SetMainText( math.floor( delta * 1000 ) )
	
	self.LastTime  = RealTime()
	
end

derma.DefineControl( "DHUI_RealTimeVariator", "", PANEL, "HIndicatorLabel" )
